<?php
class Fapiao_invoice_model extends CI_Model
{
    private $table = 'fapiao_invoice';
    
    public function insertFapiaoInvoice($order_id, $postData)
    {
        $data = array(
            'order_id'        => $order_id,
            'invoice_title'   => $postData['invoice_title'],
            'invoice_address' => $postData['invoice_address'],
        );
        $this->db->insert($this->table, $data);
        return $this->db->insert_id();
    }
    
    public function getFapiaoByOrderId($order_id)
    {
        $this->db->where('order_id', $order_id);
        return $this->db->get($this->table);
    }
}